<!--
  @author yangjiangming
  @date 2018/11/26 10:00
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head>
    <title>新增订单</title>

    <th:block th:replace="common/common :: jscss"/>

</head>

<body>

<div class="layui-fluid new-order-page">
    <div class="layui-card">
        <form method="post" onkeydown="if(event.keyCode==13){return false}" action class="layui-form" lay-filter="zmn-order-add-form">

            <input type="hidden" name="longitude" id="longitude"/>
            <input type="hidden" name="latitude" id="latitude"/>
            <input type="hidden" name="countyId" id="countyId"/>
            <input type="hidden" id="district"/>
            <!--地址info-->
            <input type="hidden" id="streetSource" name="streetSource" value="0">
            <input type="hidden" id="communityId">
            <!--<div class="layui-card-header" style="margin-top:10px;"><b>基本信息</b></div>-->
            <div class="layui-split">&nbsp;</div>

            <div>
                <!-- 用户电话 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label layui-form-required">用户电话</label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <!-- 用户电话1 -->
                            <th:block th:replace="common/_orderAddTmpl :: inputOfTelephone1"/>
                        </div>
                    </div>
                </div>
                <!-- 用户姓名 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label layui-form-required">客户姓名</label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <th:block th:replace="common/_orderAddTmpl :: inputOfUserName"/>
                        </div>
                    </div>
                </div>
                <!-- 下单渠道 -->
                <div class="layui-form-item">
                    <div class="layui-inline">

                        <label class="layui-form-label layui-form-required">下单渠道</label>
                        <div class="layui-input-inline" style="width: 505px;">
                            <select id="channelId" name="channelId" lay-verify="required" lay-filter="channelId" lay-search>
                                <option value=""></option>
                                <option th:each="channel : ${channelList}"
                                        th:value="${channel.value}"
                                        th:text="${channel.text}"
                                        th:disabled="${channel.disabled}">
                                </option>
                            </select>
                        </div>

                    </div>
                </div>
                <!-- 用户地址-省、市 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label layui-form-required">用户地址</label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <select id="provinceId" name="provinceId" lay-verify="required" lay-filter="province" lay-search>
                                <option value="">省</option>
                                <option th:each="province : ${provinceList}" th:value="${province.value}" th:text="${province.text}"></option>
                            </select>
                        </div>
                        <div class="layui-input-inline" style="width: 295px;">
                            <select id="cityId"
                                    name="cityId"
                                    lay-verify="required"
                                    lay-filter="city"
                                    lay-search>
                                <option value="">市</option>
                                <option th:selected="item.id==446000" th:each="item : ${cityList}" data-th-data-pid="${item.pid}" th:value="${item.value}" th:text="${item.text}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label" ></label>
                        <div class="layui-input-inline" id="street-wrapper" style="width: 505px;">
                            <input class="layui-input"
                                   id="customerAddress"
                                   type="text"
                                   name="street"
                                   lay-verify="required"
                                   placeholder="搜索地点，选择小区，街道，大厦..."
                                   autocomplete="off"
                                   style="padding-right: 95px;">
                        </div>
                        <div id="suggestPanel" class="suggestPanelBox layui-anim layui-anim-upbit">
                            <ul></ul>
                        </div>
                    </div>
                </div>

                <!-- 服务分类、订单类型 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label layui-form-required">服务分类</label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <select id="servCategoryId" name="servCategId" lay-verify="required" lay-filter="servCategory" lay-search>
                                <option value="">全部</option>
                                <option th:each="item : ${servCategList}"
                                        th:value="${item.value}"
                                        th:text="${item.text}">
                                </option>
                            </select>
                        </div>
                        <label class="layui-form-label layui-form-required" >服务产品</label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <select class="product-select"
                                    id="showProduct"
                                    name="showProductId"
                                    lay-verify="required"
                                    lay-filter="showProduct"
                                    lay-search>
                                <option value="">请选择</option>
                                <option th:each="item : ${servProductList}"
                                        th:value="${item.value}"
                                        th:text="${item.text}"
                                        data-th-data-unit="${ item.ext1 }"
                                        data-th-data-type="${ item.type }"
                                        data-th-data-pid="${ item.pid }">
                                </option>
                            </select>
                        </div>
                    </div>
                </div>
                <!-- 常见故障 -->
                <div class="layui-form-item" style="display: none">
                    <div class="layui-inline">
                        <label class="layui-form-label" >常见故障</label>
                        <div class="layui-input-block faults-wrapper" id="faults-wrapper"></div>
                    </div>
                </div>
                <!-- 下单备注 -->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label" style="text-align: center">未下单原因</label>
                        <div class="layui-input-inline input-large">
                            <textarea class="layui-textarea"
                                      name="remark"
                                      maxlength="500"
                                      placeholder="最长不能超500个字"
                                      lay-verify="maxLenTo500"></textarea>
                        </div>
                    </div>
                </div>
                <!-- 按钮 -->
                <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-block">
                        <div>
                            <button id="confirmbtn" type="button" class="layui-btn" lay-submit lay-filter="confirmbtn">保存</button>
                            <!--<button type="reset" class="layui-btn layui-btn-primary" >重置</button>-->
                        </div>
                    </div>
                </div>
                <div style="height: 1px"></div>
            </div>
        </form>
    </div>
</div>

<script th:inline="javascript">
    var json = {
        servProductList: [[${servProductList}]],
        cityList: [[${cityList}]]
    };

    layui.config({
        base: "/static/js/module/"
    }).extend({
        oms_purpose_add: "purpose/zmn.oms.purpose.add"
    }).use(['index', 'oms_purpose_add']);
</script>

</body>
</html>